<template>
  <div class="home-carousel">
    <el-carousel :height="'400px'">
      <el-carousel-item v-for="item in carouselItems" :key="item.id">
        <img :src="item.imgUrl" class="carousel-img" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
export default {
  name: 'HomeCarousel',
  data() {
    return {
      carouselItems: [
        {
          id: 1,
          imgUrl: 'https://via.placeholder.com/1920x400',
        },
        {
          id: 2,
          imgUrl: 'https://via.placeholder.com/1920x400',
        },
        {
          id: 3,
          imgUrl: 'https://via.placeholder.com/1920x400',
        },
      ],
    }
  },
}
</script>

<style lang="scss" scoped>
.home-carousel {
  width: 100%;

  .carousel-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
  }

  // 自定义轮播图指示器样式（可选）
  ::v-deep .el-carousel__indicators {
    .el-carousel__button {
      width: 10px;
      height: 10px;
      border-radius: 50%;
    }
  }
}
</style>